package com.example.springmybatis.service;

import com.example.springmybatis.entity.news;
import com.example.springmybatis.entity.news_categories;
import com.example.springmybatis.mapper.Newsmapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Newsservice {
    @Resource
    private Newsmapper newsmapper;

    public List<news> getnews(){
        List<news> news=newsmapper.selectnewall();
        return news;
    }
    public List<news_categories> getcate(){
        List<news_categories> news_categories=newsmapper.selectnewcateall();
        return news_categories;
    }
}
